using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace Client
{
    public partial class MainWindow : Form
    {
        private static MainWindow instance;
        private VideoSettings vs;

        private MainWindow()
        {
            InitializeComponent();
            vs = new VideoSettings();
        }

        public static void Main(string[] args)
        {
            // Configure logger
            Engine.Logger.Configure("data/config/log4net.cfg.xml");

            Application.Run(MainWindow.Instance);
        }

        public static MainWindow Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new MainWindow();
                }

                return instance;
            }
        }

        private void btnWebsite_Click(object sender, EventArgs e)
        {
            Process.Start("http://code.google.com/p/doublej/");
        }

        private void btnPlay_Click(object sender, EventArgs e)
        {
            // Hide main window
            MainWindow.Instance.Visible = false;

            // Initiate game
            GameForm instance = new GameForm(vs);

            // Show game
            instance.Window.ShowDialog();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            vs.ShowDialog();
        }
    }
}